import { MockMethod } from 'vite-plugin-mock';
import tools from '../json/tools.json';

export default [
  {
    url: '/dev-api/tools/list',
    method: 'get',
    response: () => {
      return tools;
    },
  },
  {
    url: '/dev-api/tool/detail',
    method: 'post',
    response: (options: any) => {
      const form = options.body;
      const dataList = tools.list.filter((J) => J.route == form.route);
      
      return {
        data: dataList[0],
      };
    },
  },
] as MockMethod[]; // 这里其实就是定义数据格式的，不了解的同学可以参考typescript的官方文档
